import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
Vue.config.productionTip = false;

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);

//echarts配置
import * as echarts from 'echarts';
Vue.prototype.$echarts = echarts;

import axios from './http';//开启路由拦截器
// import axios from 'axios';
Vue.prototype.$http = axios;

Vue.filter('time', function (val) {
  let now = new Date(val)
  var Y = now.getFullYear()
  var M = now.getMonth() + 1
  var D = now.getDate()
  var H = now.getHours() + ''
  H = H.padStart(2, 0)
  var m = now.getMinutes() + ''
  m = m.padStart(2, 0)
  var s = now.getSeconds() + ''
  s = s.padStart(2, 0)
  return ` ${Y}-${M}-${D} ${H}:${m}:${s}`
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
